<template>
  <div class="productList">
    <div v-for="(item, index) in list" :key="index" class="item" @click="$router.push('/productDetail?id=' + item.id)">
      <img :src="IMGBASEURL + item.mainImage" alt="" width="100%">
      <h4>{{item.name}}</h4>
      <div>
        <font color="#ff7800" size="3">{{item.price}}元</font>
        <img class="icon" src="/vue/imgs/icon-cart-hover.png" alt="" width="15px" height="15px">
      </div>
      <div class="info">
        {{item.subTitle}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ProductList",
  props : ['list'],
  methods : {

  }
}
</script>

<style lang="scss" scoped>
.productList{
  display: flex;
  flex-wrap: wrap;
  margin: 20px 0;
  .item{
    width: 280px;
    margin: 10px;
    text-align: center;
    cursor: pointer;
    .icon{
      padding-top: 5px;
    }
    .info{
      margin-top: 20px;
      border-top: 1px solid #E0E0E0;
      padding: 5px;
    }
  }
}
</style>